<?php
namespace Home\Model;
use Think\Model;

/**
* 
*/
class ShopModel extends Model
{
	function shopsw($userid)
    {
        $result = $this->field('*')->where("userid=".$userid)->find();
        
        return $result;
    }
	function shopreg($res,$id = 0)
	{
        if($id)
        {
            $this->where('id='.$id)->save($res);
        }
        else
        {
           $result = $this->add($res);
           if($result)
           {
            $id = $result;
           }
           //return $id; 
        }
        return true;
	}

}